<?php

/*
* Manages user actions for a specific page. All site specific user actions should be there
* @author    René Giller
* @version   1.0
* @date      10.02.2009
*/
class Controller_user extends Controller {

    /**
    * process the data according to the current page
    */
    public function proceed() {
        global $model;
        
        switch($this->currentPage) {
            case 'contact' :
                $tel = $model->getFieldValue('contactTel');
                $text = "Nom : ".$model->getFieldValue('contactName')."\n";
                $text .= "e-mail : ".$model->getFieldValue('contactEmail')."\n";
                $text .= "Adresse : ".$model->getFieldValue('contactAddress')."\n";
                $text .= "T&eacute;l : ".substr($tel, 0, 3)."/".substr($tel, 3, 3).".".substr($tel, 6, 2).".".substr($tel, 8, 2)."\n\n\n";
                $text .= $model->getFieldValue('contactDemand');
                $this->sendMail(MAIL, $model->getFieldValue('contactEmail'), $model->getFieldValue('contactSubject'), $text);
                break;
        }
    }
}